<script setup lang="ts">
import { onMounted } from 'vue'
import { useAuthStore } from '@/stores/auth.store'
import { navigateTo } from '#app'

const authStore = useAuthStore()

// 页面加载时检查登录状态并重定向
onMounted(() => {
  if (authStore.isLoggedIn) {
    navigateTo('/chat')
  } else {
    navigateTo('/login')
  }
})
</script>

<template>
  <div class="flex items-center justify-center min-h-screen">
    <div class="text-center">
      <div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"></div>
      <p class="text-gray-600">正在加载...</p>
    </div>
  </div>
</template>